import axios from '@/libs/api.request'

export class FinanceInvoiceApi {
  // 获取发票申请数据
  static getAddResponse (params) {
    return axios.request({
      url: '/FinanceInvoice/GetAddResponse',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 新增发票申请
  static addFinanceInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/AddFinanceInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 获取替换票数据
  static getReplaceResponse (params) {
    return axios.request({
      url: '/FinanceInvoice/GetReplaceResponse',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 退换票申请
  static replaceFinanceInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/ReplaceFinanceInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 获取发票列表
  static getFinanceInvoiceList (params) {
    return axios.request({
      url: '/FinanceInvoice/GetFinanceInvoiceList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 获取 编辑|开票 数据
  static getInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/GetInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 获取 查看 数据
  static getInvoiceInfo (params) {
    return axios.request({
      url: '/FinanceInvoice/GetInvoiceInfo',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 编辑发票信息
  static editFinanceInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/EditFinanceInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 修改发票状态
  static changeFinanceInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/ChangeFinanceInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 开票
  static invoice (params) {
    return axios.request({
      url: '/FinanceInvoice/Invoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 退票
  static applyBackInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/ApplyBackInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }
  
  // 退票审核
  static approvalBackInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/ApprovalBackInvoice',
      method: 'get',
      enctype: 'multipart/form-data',
      params: params
    })
  }
  

  // 导出发票申请
  static exportInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/ExportInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导入
  static importInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/ImportInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 获取即时发票申请数据
  static getForthwithAddResponse (params) {
    return axios.request({
      url: '/FinanceInvoice/GetForthwithAddResponse',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 新增即时开票
  static addForthwithFinanceInvoice (params) {
    return axios.request({
      url: '/FinanceInvoice/AddForthwithFinanceInvoice',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出开票明细
  static export (params) {
    return axios.request({
      url: '/FinanceInvoice/Export',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出发票台账
  static exportInvoiceBill (params) {
    return axios.request({
      url: '/FinanceInvoice/ExportInvoiceBill',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出应收单
  static exportReceivabl (params) {
    return axios.request({
      url: '/FinanceInvoice/ExportReceivabl',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出应付单
  static exportPayable (params) {
    return axios.request({
      url: '/FinanceInvoice/ExportPayable',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 申请开票添加获取默认开票方式
  static getDefaultInvoiceManner (params) {
    return axios.request({
      url: '/FinanceInvoice/GetDefaultInvoiceManner',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }
}
